\chapter{Introduction}

\section{So\ldots what's XC?}
The ``Finite Element Analysis (FEA)'' or ``Finite Element Method (FEM)'' is a numerical method for solving problems of engineering and mathematical physics. This method has proven to be useful to solve problems with one of more of the following characteristics:

\begin{itemize}
\item complicated geometries
\item complicated load patterns (in space and/or in time).
\item complicated material properties.
\end{itemize}

XC is an open source FEA program designed to solve structural analysis problems. The program can solve various types of problems, from simple linear analysis to complex nonlinear simulations. It has a library of finite elements which allows to model various geometries, and multiple material models, allowing its application in various areas of structural analysis.

\section{Motivation}
Someone said that, when the French climber Lionel Terray was asked about his reason to climb a mountain, he simply said ``because it's there''.

Something similar happens with the development of this program. Since I began the study of the finite element method, after studying the analytic solutions to elastic problems (so limited), the scope of their employment to meet structural problems brought on me a great attraction. This, coupled with my love with computer science, made me decide to develop a finite element program that would be useful to calculate structures and that could be modified an expanded in any way the user wanted (a bit optimistic, yeah\ldots). So, first I wrote a Pascal version of the program which could only work with bar-type elements. Afterwards, I wrote a C++ version ``from scratch'' that was never be able to solve any nontrivial problem. Finally I've discovered the possibilities offered by the calculation core of \emph{Opensees} and I decided to modify it so it was able to be used in a "engineering office environment" (as opposed to academic use) so to speak.

To achieve this objective, the main modifications made to the original code were as follows:

\begin{enumerate}
\item Incorporation of some simple algorithms for generation of the finite element mesh. The modeler is able to create structured grids from the description of geometry by means of points, lines, surfaces and solids.

\item Generating graphics using \href{http://www.vtk.org}{VTK} library. This is an open source library for generating graphics for scientific use. 

\item At first I've used a macro language, built from the ground, which served to expose all the values from the model (displacements, internal forces, strains, stresses,\ldots) in a way that allows the user to formulate a sentence like ``get the ratio between the vertical displacement of the node closest to the center of the beam an the total span of the beam''. In 2013 we stopped the development of that custom language and start the migration to Python which was finished in 2015. 

\item Utilities for the construction and calculation of design load combinations prescribed by the building codes (EHE, ACI 318, EAE, Eurocodes ,\ldots) so as to facilitate the verification of design requirements on each of them.

\item Ability to activate and deactivate elements to enable the analysis of structures built in phases, of geotechnical engineering problems and the strengthening of existing structures.

\item Writing macros to verify the structure and its elements according the criteria prescribed by building codes (axial and bending capacity, shear reinforcement,\ldots).

\item Changing the code so it's linked with ``standard'' linear algebra libraries (BLAS, Arpack, LAPACK, SuperLU ,...). This eliminates the need to include in the program ``ad-hoc'' versions of these libraries.

\item Modification of the material models so that support prescribed strains. That makes possible to solve problems involving thermal and rheological actions.

\item Implementation of MP constraints that allows to fix a node to an arbitrary position of an element (the code is based mostly on the article \href{http://www.code-aster.org/V2/doc/v10/fr/man_r/r7/r7.01.02.pdf}{Modélisation des câbles de précontrainte}. This way we can attach the linear elements, used to model steel cables, to bi-dimensional o three-dimensional elements.

\end{enumerate}

\section{XC foundations (on the shoulders of giants)}
The libraries and programs on which XC relies are the following:

\begin{itemize}
  \item \href{https://www.python.org/}{Python}: user's programming language (\href{https://wiki.python.org/moin/boost.python}{boost.python} interface with OpenSees based C++ kernel).
  \item \href{http://opensees.berkeley.edu}{OpenSees}: finite element analysis kernel.
  \item \href{http://www.vtk.org/}{VTK}: visualization routines.
  \item \href{http://www.cgal.org/}{CGAL}: computational geometry algorithms library.
  \item \href{http://www.numpy.org/}{NumPy}: numerical computation.
  \item \href{https://www.scipy.org/}{SciPy}: scientific computing tools for Python.
  \item \href{https://www.latex-project.org/}{LaTeX}: document typesetting.
  \item \href{http://matplotlib.org/}{matplotlib}: plotting all kind of math related figures...
\end{itemize}

\subsection{Capabilities}
The main capabilities of the program are:

\begin{itemize}
  \item Geometry modeling and mesh generation tools.
  \item OD, 1D, 2D and 3D elements.
  \item Linear and non-linear analysis, static and dynamic.
  \item Fiber section models (modelization of RC members,...).
  \item Activation an deactivation of elements (construction phases,...).
  \item Tools for implementing structural codes (Eurocodes, ACI, AISC,...) verifications (in progress...).
  \item Interfaces with Salome and SCIA (in progress...).
\end{itemize}

XC inherits from OpenSees its advanced capabilities for modeling and analyzing the nonlinear response of systems using a wide range of material models, elements, and solution algorithms. The analysis kernel is designed for parallel computing\footnote{The Python interface and verifications tests for these capabilities are not yet implemented.} to allow scalable simulations on high-end computers or for parameter studies.

\subsection{Model components}

The programs allows the creation of bi or three-dimensional models with 2,3 or 6 degrees of freedom. The finite element library provides 1D elements (truss and beam-column elements), 2D and 3D elements for continuum mechanics and 2D shell elements.

\subsection{Analysis}
Nonlinear analysis requires a wide range of algorithms and solution methods. XC provides nonlinear static and dynamic methods, equation solvers, and methods for handling constraints.

\section{Open source}
XC is open-source. This manual provides information about the software architecture, access to the source code, and the development process. The \href{https://opensource.org/}{open-source}\footnote{See also \href{http://www.unterstein.net/su/docs/CathBaz.pdf}{The Cathedral and the Bazaar} by Eric Raymond, which inspired Netscape's decision to release it's browser as open-source software.} movement allows researchers and users to build upon each others accomplishments using XC as community-based software.

\section{Getting started}

The natural way to get started is to download the software, compile it\footnote{Yes, for the time being there is no DEB nor RPM binary packages available.} and run some examples.

\begin{itemize}
\item Primo. Go to \href{https://github.com/xcfem/xc_utils}{xc\_utils} repository, download the code and follow the instructions on \href{https://github.com/xcfem/xc_utils/blob/master/install.txt}{install.txt}.
\item Secondo. Go to \href{https://github.com/xcfem/xc}{xc} repository, download the code and follow the instructions on \href{https://github.com/xcfem/xc/blob/master/install.txt}{install.txt}.
\item You can test some of the examples in \href{https://github.com/xcfem/xc/tree/master/verif/tests}{tests}.
\end{itemize}






%%  LocalWords:  FEA XC OpenSees VTK CGAL NumPy SciPy LaTeX Eurocodes
%%  LocalWords:  matplotlib modelization Terray Opensees EHE ACI EAE
%%  LocalWords:  BLAS Arpack LAPACK SuperLU AISC
